﻿namespace NMortgage.UI.Tests
{
    using System;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using NMortgage.UI.Model;

    /// <summary>
    ///This is a test class for FixedRateTest and is intended
    ///to contain all FixedRateTest Unit Tests
    ///</summary>
    [TestClass]
    public class FixedRateTest
    {
        #region Fields

        private TestContext testContextInstance;

        #endregion Fields

        #region Properties

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #endregion Properties

        #region Methods

        /// <summary>
        ///A test for Description
        ///</summary>
        [TestMethod]
        public void DescriptionTest()
        {
            FixedRate target = new FixedRate() { Rate = 1d };
            string actual;
            actual = target.Description;
            Assert.IsNotNull(actual);
        }

        /// <summary>
        ///A test for FixedRate Constructor
        ///</summary>
        [TestMethod]
        public void FixedRateConstructorTest()
        {
            FixedRate target = new FixedRate();
            Assert.IsNotNull(target);
        }

        /// <summary>
        ///A test for GetRate
        ///</summary>
        [TestMethod]
        public void GetRateTest()
        {
            FixedRate target = new FixedRate();
            double expected = 0.03d;
            double actual;
            target.Rate = expected*100;
            actual = target.GetRate();
            Assert.AreEqual<double>(expected, actual);
        }

        /// <summary>
        ///A test for Rate
        ///</summary>
        [TestMethod]
        public void RateTest()
        {
            FixedRate target = new FixedRate();
            double expected = 0d;
            double actual;
            target.Rate = expected;
            actual = target.Rate;
            Assert.AreEqual<double>(expected, actual);
        }

        #endregion Methods

        #region Other

        //
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //

        #endregion Other
    }
}